package io.github.talelin.latticy.model;


import io.github.talelin.latticy.dto.rule.chargeCondition.ChargeAbsoluteUpdateDTO;
import io.github.talelin.latticy.dto.rule.chargeItem.ChargeAbsoluteDTO;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

/**
 * @author generator@wulongbo
 * @since 2022-08-25
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("charge_absolute")
public class ChargeAbsoluteDO extends BaseModel {


    /**
     * 规则项id
     */
    private Integer chargeItemId;

    /**
     * 规则key id
     */
    private Integer ruleKeyId;

    /**
     * 模板key
     */
    private String ftlKey;

    /**
     * 输入框的值
     */
    private String ruleValueId;

    /**
     * 上限
     */
    private String max;

    /**
     * 下限
     */
    private String min;

    /**
     * 1 ：向下取整 ；2 ： 向上取整； 4： 四舍五入
     */
    private Integer accuracy;

    public ChargeAbsoluteDO(ChargeAbsoluteDTO dto, Integer chargeItemId) {
        BeanUtils.copyProperties(dto, this);
        this.chargeItemId = chargeItemId;
    }

    public ChargeAbsoluteDO(ChargeAbsoluteUpdateDTO dto, Integer chargeItemId) {
        BeanUtils.copyProperties(dto, this);
        this.chargeItemId = chargeItemId;
    }

}
